﻿// HSS.Forms.IConfigurationDataEditor.cs
// ----------------------------------------------------------------------------
// Licensed under the MIT license
// http://www.opensource.org/licenses/mit-license.html
// ----------------------------------------------------------------------------
// HighSpeed-Solutions, LLC
// Copyright (c) 2001-2010
// ----------------------------------------------------------------------------
// File:       IConfigurationDataEditor.cs
// Author:     HSS\gbanta
// Created:    08/12/2010
// Modified:   12/04/2010
// ----------------------------------------------------------------------------
namespace HSS.Forms
{
	#region Using Directives
	using System;
	using System.Windows.Forms;
	#endregion

	#region IConfigurationDataEditor<T>
	/// <summary>
	/// A configuration editor interface.
	/// </summary>
	/// <typeparam name="T">The concrete Type being edited.</typeparam>
	public interface IConfigurationDataEditor<T> : IDisposable where T : IConfigurationElement
	{
		/// <summary>
		/// Implement this method to receive the <see cref="IConfigurationElement"/>.
		/// </summary>
		/// <param name="data">The <see cref="IConfigurationElement"/> to load.</param>
		void LoadData(T data);
		/// <summary>
		/// Creates an instance of the type T (<see cref="IConfigurationElement"/>).
		/// </summary>
		/// <returns>The concrete <see cref="IConfigurationElement"/> implemented object.</returns>
		T GetData();
		/// <summary>
		/// Shows the Editor.
		/// </summary>
		/// <returns>The editors <see cref="DialogResult"/>.</returns>
		DialogResult ShowDialog();
	}
	#endregion
}